package com.itheima.service.impl;

import com.itheima.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author XCQ
 */
@Service("userService3")
public class UserSetviceImpl3 implements UserService {
    public UserSetviceImpl3() {
        System.out.println("userService3  init...");
    }

    @Override
    public void add() {
        System.out.println("add run...");
    }

    @Override
    public String getName(String data) {
        return data;
    }


    @PostConstruct //先构造对象在执行init方法
    public void initUser(){
        System.out.println("initUser run....");
    }

    @PreDestroy //指定销毁方法
    public void destroyUser(){
        System.out.println("destroyUser run...");
    }
}
